home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 4 / FM Towns Free Software Collection 4 - Disc 1.iso / t_os / wstype / source / srom.s < prev    next >
Text File  |  1991-10-18  |  1KB  |  101 lines

  1. /***   [srom.s]
  2. *
  3. *    システムロム 関連    (C)ささがわ
  4. *
  5. *    For GNU Assembler (GAS)
  6. *
  7. ***/
  8.  
  9.     .text
  10. /* int SROM_mos(int no, int x, int y, int color) */
  11.     .align    2
  12. _SROM_mos:
  13.     .globl    _SROM_mos
  14.     enter    $0, $0
  15.     pushl    %esi
  16.     pushl    %edi
  17.     
  18.     cld
  19.     movb    $4, buf
  20.     movb    $32, buf + 1
  21.     pushl    %ds
  22.     popl    %es
  23.     movl    $buf + 2, %edi
  24.     movl    $128, %ecx
  25.     movl    $0, %eax
  26.     rep
  27.     stosl
  28.     
  29.     pushl    %ds
  30.     movl    $buf + 2, %edi
  31.     movl    8(%ebp), %esi
  32.     decl    %esi
  33.     shll    $8, %esi
  34.     addl    $0x28000, %esi
  35.     pushl    %ds
  36.     popl    %es
  37.     pushl    $0x0108
  38.     popl    %ds
  39.     
  40.     movl    $128, %ecx
  41. _SROM_icn_la:
  42.     pushl    %ecx
  43.     
  44.     movb    (%esi), %al
  45.     movb    128(%esi), %ah
  46.     movl    $8, %ecx
  47. _SROM_icn_lb:
  48.     pushw    %cx
  49.     movb    %ah, %dl
  50.     decb    %cl
  51.     shrb    %cl, %dl
  52.     testb    $1, %dl
  53.     jz    _SROM_icn_ga
  54.     movb    $0, %dl
  55.     jmp    _SROM_icn_gb
  56. _SROM_icn_ga:
  57.     movb    %al, %dl
  58.     shrb    %cl, %dl
  59.     testb    $1, %dl
  60.     jz    _SROM_icn_gc
  61.     movb    %es:_PAL_Black, %dl
  62.     jmp    _SROM_icn_gb
  63. _SROM_icn_gc:
  64.     movb    %es:20(%ebp), %dl
  65. _SROM_icn_gb:
  66.     popw    %cx
  67.     testb    $1, %cl
  68.     jz    _SROM_icn_gd
  69.     shlb    $4, %dl
  70.     addb    %dl, %es:(%edi)
  71.     incl    %edi
  72.     jmp    _SROM_icn_ge
  73. _SROM_icn_gd:
  74.     addb    %dl, %es:(%edi)
  75. _SROM_icn_ge:
  76.     loop    _SROM_icn_lb
  77.     incl    %esi
  78.     
  79.     popl    %ecx
  80.     loop    _SROM_icn_la
  81.     
  82.     movl    $32, %ecx
  83.     rep
  84.     movsl
  85.     
  86.     popl    %ds
  87.     
  88.     pushl    $buf
  89.     pushl    16(%ebp)
  90.     pushl    12(%ebp)
  91.     pushl    $2
  92.     call    _MOS_type
  93.     addl    $16, %esp
  94.     
  95.     popl    %edi
  96.     popl    %esi
  97.     leave
  98.     ret
  99.  
  100.     .lcomm    buf, 642
  101.